package cn.bearspark.api.controller.main;

import cn.bearspark.api.service.main.InfoService;
import cn.bearspark.api.vo.main.info.UserInfoRespVO;
import cn.bearspark.framework.web.starter.vo.ResponseVO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 信息模块
 *
 * @author f
 */
@RestController
@RequestMapping("/info")
public class InfoController {

    private final InfoService infoService;

    public InfoController(InfoService infoService) {
        this.infoService = infoService;
    }

    /**
     * 获取用户信息
     *
     * @return 用户的信息
     */
    @GetMapping("/user")
    public ResponseVO<UserInfoRespVO> userInfo() {
        return ResponseVO.success(infoService.userInfo());
    }

}
